package day04;
import java.util.Scanner;

public class Prictise {
    public static void main(String[] args) {
        //CommandBySwitch命令解析程序：
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能：1.存款 2.转账 3.取款 4.退出");
        int command = scan.nextInt();
        switch (command){
            case 1:
                System.out.println("存款业务...");
                break;
            case 2:
                System.out.println("转账业务...");
                break;
            case 3:
                System.out.println("取款业务...");
                break;
            case 4:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("操作失败");

        }



        //Guessing猜数字
        Scanner scan2 = new Scanner(System.in);
        int num = (int)(Math.random()*1000+1);
        System.out.println("猜吧！");
        int guess = scan2.nextInt();
        while (guess !=num){
            if (guess>num){
                System.out.println("猜大了！");
            }else {
                System.out.println("猜小了！");
            }
            System.out.println("猜吧！");
            guess = scan2.nextInt();
        }
        System.out.println("恭喜你，猜对了！");






        Scanner scan3 = new Scanner(System.in);
        int num2 = (int)(Math.random()*1000+1);
        int guess2;
        do {
            System.out.println("猜吧！");
            guess2 = scan3.nextInt();
            if (guess2>num2){
                System.out.println("猜大了！");
            }else if (guess2<num2){
                System.out.println("猜小了！");
            }else {
                System.out.println("恭喜你，猜对了！");
            }


        }while(guess2!=num2);







        //for循环:
        //1)输出5次"行动是成功的阶梯"
        for (int times=0;times<5;times++){
            System.out.println("行动是成功的阶梯");

        }
        System.out.println("继续执行...");




        //2)9的乘法表：
        for (int num3 = 1;num3<=9;num3++){
            System.out.println(num3+"*9="+num3*9);
        }
        System.out.println("继续执行......");



        for (int num3 = 1;num3<=9;num3+=2){
            System.out.println(num3+"*9="+num3*9);
        }
        System.out.println("继续执行......");



        for (int num3 = 9;num3>=1;num3--){
            System.out.println(num3+"*9="+num3*9);
        }
        System.out.println("继续执行......");






        //CommandBySwitch命令解析程序：
        Scanner scan4 = new Scanner(System.in);
        System.out.println("请选择功能：1.存款 2.转账 3.取款 4.退出");
        int command2 = scan4.nextInt();
        switch (command2) {
            case 1:
                System.out.println("存款操作......");
                break;
            case 2:
                System.out.println("转账操作......");
                break;
            case 3:
                System.out.println("取款操作......");
                break;
            case 4:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("操作失败");
        }



                //Guessing猜数字
                Scanner scan5 = new Scanner(System.in);
                int num3 = (int)(Math.random()*1000+1);
                int guess3 = scan5.nextInt();
                while (guess3!=num3){
                    if (guess3>num3){
                        System.out.println("猜大了！");
                    }else {
                        System.out.println("猜小了！");
                    }
                    System.out.println("猜吧！");
                    guess3 = scan5.nextInt();
                }
                System.out.println("恭喜你，猜对了！");



                Scanner scan6 = new Scanner(System.in);
                int num4 = (int)(Math.random()*1000+1);
                int guess4;
                do {
                    System.out.println("猜吧！");
                    guess4 = scan6.nextInt();
                    if (guess4>num4){
                        System.out.println("猜大了！");
                    }else if (guess4<num4){
                        System.out.println("猜小了！");
                    }else {
                        System.out.println("恭喜你，猜中了！");
                    }

                }while (guess4!=num4);







                for (int times=0;times<5;times++){
                    System.out.println("行动是成功的阶梯");
                }
                System.out.println("继续执行......");



                for (int num5=1;num5<=9;num5++){
                    System.out.println(num5+"*9="+num5*9);
                }


                for (int num6=9;num6>=1;num6--){
                    System.out.println(num6+"*9="+num6*9);
                }



                for (int num7 =1;num7<=9;num7+=2 ){
                    System.out.println(num7+"*9="+num*9);
                }


























    }





}
